/*
 * Copyright (C) 2010 Ryan Morton
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.games.rm.patternpuzzler;

public class HighScore implements Comparable<HighScore>
{
	private String myDate;
	private int myGameType;
	private int myLevel;
	
	public HighScore(String date, int gameType, int level) 
	{
		myDate = date;
		myGameType = gameType;
		myLevel = level;
	}
	
	@Override
	public int compareTo(HighScore other)
	{
		if(this.getGameType()==other.getGameType())
		{
			if(this.getLevel()==other.getLevel())
			{
				return 0;
			}
			else if(this.getLevel()>other.getLevel())
			{
				return -1;
			}
			else 
			{
				return 1;
			}
		}
		else
		{
			if(this.getGameType()>other.getGameType())
			{
				return -1;
			}
			else 
			{
				return 1;
			}
		}
	}
	
	@Override
	public String toString()
	{
		return myDate+";"+myGameType+";"+myLevel;
	}

	//*********GETTERS*************/
	public String getDate()
	{
		return myDate;
	}

	public int getGameType()
	{
		return myGameType;
	}
	
	public int getLevel()
	{
		return myLevel;
	}
}
